<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<script type="text/javascript">
	function check(qnaNo,qnaRestep) {
		window.open("qna.do?command=qnaCheckPasswordView&qnaNo="+qnaNo+"&qnaRestep="+qnaRestep,"","resizable=true,toolbar=no,width=400,height=250");
		window.opener.closed();
	}
</script>
<style type="text/css"> 
 
	table#con_table{width:800px; color:#555555; font-size:12px; text-align:center; border-top:1px solid #575757;border-bottom:1px solid #575757}
	table#con_table a{text-decoration:none; color:#CDA9A9;}
	table#con_table a:hover{text-decoration:underline; color:#892525;}
	table#con_table th{background:#8FBD24; padding:8px 0; border-bottom:1px solid #7B7B7B}
	table#con_table td{padding:10px 0 10px 0; background:#fff;border-bottom:1px dashed #CDCDCD}
	table#con_table tr.gry td{background:#f2f2f0;}
	table#con_table tr.last td{border-bottom:0px;}
</style>

<script type="text/javascript"> 
	function tdBgChanger(){
		var trs = document.getElementById('con_table').getElementsByTagName('tr');
		var finalNum = Number(trs.length - 1);
		for(var j=0;j<trs.length;j++){
			
			if(j%2 == 0){
				trs[j].className = 'gry';
				if(j == finalNum){
					trs[j].className = 'gry last';
				}
			}else{
				if(j == finalNum){
					trs[j].className = 'last';
				}
			}
		}
	}
</script>

<img src="${initParam.root }/img/qna_top.gif"><br>


<table cellpadding="0" cellspacing="0" id="con_table" align="center">
	<thead>
		<tr>
			<th>번호</th>
			<th>제목</th>
			<th>작성자</th>
			<th>작성일</th>
			<th>조회횟수</th>
		</tr>
	</thead>
	<tbody>
	<c:forEach items="${requestScope.listVO.list }"  var="list">
		<tr>
			<td>${list.qnaNo }</td>
			<td>
			<c:if test="${list.qnaRelevel!=0}">
					<c:forEach begin="0" end="${list.qnaRelevel }" step="1">&nbsp;</c:forEach>
					<img src="${initParam.root }/img//reply.jpg" >
						</c:if>
<%-- <a href="qna.do?command=qnaCheckPasswordView&qnaNo=${list.qnaNo }&page=${requestScope.listVO.pagingBean.nowpage }">${list.qnaTitle }</a></td> --%>
   <span style="cursor:pointer" onclick="check(${list.qnaNo },${list.qnaRestep })">${list.qnaTitle }</span></td>
	

			<td>${list.member.id  }</td>
			<td>${list.qnaDate }</td>
			<td>${list.qnaCount }</td>
		</tr>
	</c:forEach>
	</tbody>
</table><br>

<script type="text/javascript" >tdBgChanger()</script>


<form align="center">
<c:if test="${requestScope.listVO.pagingBean.previousPageGroup }">
	<a href="qna.do?command=qnaAllBoardList&page=${requestScope.listVO.pagingBean.startPageOfPageGroup-1 }"><img src="${initParam.root }/img/left_arrow_btn.gif"></a>	
	</c:if>	
	
<c:forEach var="i"  begin="${requestScope.listVO.pagingBean.startPageOfPageGroup }" end="${requestScope.listVO.pagingBean.endPageOfPageGroup }">
<c:choose>
<c:when  test="${requestScope.listVO.pagingBean.nowpage!=i }">
<a href="qna.do?command=qnaAllBoardList&page=${i }">${i }</a>
</c:when>
<c:otherwise>
${i }
</c:otherwise>
</c:choose>
</c:forEach>


<c:if test="${requestScope.listVO.pagingBean.nextPageGroup }">
	<a href="qna.do?command=qnaAllBoardList&page=${requestScope.listVO.pagingBean.endPageOfPageGroup+1}">
	<img src="${initParam.root }/img/right_arrow_btn.gif"></a>
	</c:if>
<br><br>
</form>

<c:if test="${sessionScope.mvo!=null }">
<span style="margin-left: 750px;"><a href="qna.do?command=qnaWriteView"><img src="${initParam.root }/img/write_btn.gif" ></a></span>
</c:if>
</html>